import { baseUrlApi, requestClient, type Result } from '#/api/request';

/*资源列表*/
export const getResources = () => {
  return requestClient.get<Result>(baseUrlApi('/portal/admin/resourcees/getResourcesdata'));
};

export const getSourcesDetail = (id: number) => {
  return requestClient.get<Result>(
    baseUrlApi(`/portal/admin/resources/getSourcesDetail/${id}`)
  );
};





export const updateResources = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/resourcees/updateResources'), data);
};

// export const getProductTypesApi = () => {
//   return requestClient.get<Result>(baseUrlApi('/admin/resources'));
// };

// export const getResourceTypesApi = () => {
//   return requestClient.get<Result>(baseUrlApi('/admin/resources'));
// };

// export const saveFormApi = () => {
//   return requestClient.get<Result>(baseUrlApi('/admin/resources'));
// };

// export const uploadApi = () => {
//   return requestClient.get<Result>(baseUrlApi('/admin/resources'));
// };





export const getCatalogCategory = () => {
  return requestClient.get<Result>(baseUrlApi('/portal/admin/resourcees/getCategoryList'));
};



export const CatalogList = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/resourcees/getResourcesList'), data);
};
export const UpdateName = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/resourcees/update/name'), data);
};

//批量删除
export const batchdelete = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/resourcees/batch/delete'), data);
};

/** 删除 */
export const deleteCatlog = (id: number) => {
  return requestClient.delete<Result>(
    baseUrlApi(`/portal/admin/resourcees/${id}`),
  );
};


export const UpdateSort = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/resourcees/upload/sort'), data);
};


export const UpdateCoverImage = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/resourcees/save/CoverImage'), data);
};

export const getpassword = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/resourcees/getpassword'), data);
};
export const savepassword = (data?: object) => {
  return requestClient.post<Result>(baseUrlApi('/portal/admin/resourcees/savepassword'), data);
};


